﻿#include "FITKAbaBoundaryConditionSymmetry.h"
#include "FITK_Kernel/FITKCore/FITKDataRepo.h"
#include "FITK_Interface/FITKInterfaceModel/FITKCoordinateSystem.h"


Interface::FITKAbaAbstractBoundaryCondition::FITKAbaBoundaryConditionType Interface::FITKAbaBoundaryConditionSymmetry::getBoundaryConditionType() const
{
    return Interface::FITKAbaAbstractBoundaryCondition::FITKAbaBoundaryConditionType::SymmetryAntisymmetryEncastre;
}

bool Interface::FITKAbaBoundaryConditionSymmetry::isModifiedInStep(int stepId) const
{
    return false;
}

void Interface::FITKAbaBoundaryConditionSymmetry::activeStateChanged()
{
    //在分析步中激活状态发生变化式，对数据进行调整。该类型数据在后续分析中步不可改变，无需调整
}

bool Interface::FITKAbaBoundaryConditionSymmetry::copy(Core::FITKAbstractDataObject* obj)
{
    bool ok = FITKAbaAbstractBoundaryCondition::copy(obj);
    if (!ok)
        return false;
    FITKAbaBoundaryConditionSymmetry* sym = dynamic_cast<FITKAbaBoundaryConditionSymmetry*>(obj);
    if (sym == nullptr)
        return false;
    m_type = sym->m_type;
    m_csysId = sym->m_csysId;
    return true;
}

Interface::AbaSymmetryAntisymmetryEncastreType::SymmetryAntisymmetryEncastreType Interface::FITKAbaBoundaryConditionSymmetry::getType() const
{
    return m_type;
}

void Interface::FITKAbaBoundaryConditionSymmetry::setType(AbaSymmetryAntisymmetryEncastreType::SymmetryAntisymmetryEncastreType type)
{
    m_type = type;
}

int Interface::FITKAbaBoundaryConditionSymmetry::getCsysId() const
{
    return m_csysId;
}

void Interface::FITKAbaBoundaryConditionSymmetry::setCsysId(int id)
{
    m_csysId = id;
}

Interface::FITKCoordinateSystem* Interface::FITKAbaBoundaryConditionSymmetry::getCsysObj()
{
    if (m_csysId < 0) return nullptr;
    return FITKDATAREPO->getTDataByID<FITKCoordinateSystem>(m_csysId);
}
